// pages/teacher/edit/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    banjiId: String,
    banjiName: String
  },

  /**
   * 组件的初始数据
   */
  data: {
    // classname: "",
  },

  observers: {
    banjiId: function (value) {
      if (value == undefined) return
      this.loadData()
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    loadData: function () {
      // let classname = this.data.banjiName
      this.setData({
        // classname: classname,
        banjiName: this.data.banjiName
      })
    },
    onEdit: function (e) {
      // console.log(this.data)  
      wx.navigateTo({
        url: '/pages/teacher/editClass/index',
        success: res => {
          res.eventChannel.emit("send", this.data)
        },
        // events: {
        //   edit: () => {
        //     this.loadData()
        //   }
        // }
      })
    }
  }
})